<%--
  Created by IntelliJ IDEA.
  User: dusy
  Date: 2017/11/23
  Time: 8:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <jsp:include page="../../head.jsp"/>
    <title>业务操作效率查询</title>
    <script type="text/javascript">
        var formSetting = {
            title: "业务操作效率查询",
            module: 'query',
            numCount: '3',
            columns: [
                {
                    name: "DECLARATION_TYPE",
                    label: "业务类型",
                    type: "dropdown",
                    data: [["进口", "I"], ["出口", "E"]],
                    op: "eq",
                    minLength: 0
                }, {
                    name: "SUP_ID",
                    label: "报关行",
                    type: "dropdown",
                    dropdownType: "ajax",
                    url: "../../order-dropdown/supCompany",
                    op: "eq",
                    minLength: 0,
                    keyWordName: "key",
                    success: function (data) {
                        data = data.results;
                        var array = new Array();
                        $.each(data, function (i, n) {
                            array.push([n["name"], n["value"]]);
                        });
                        return array;
                    },
                }, {
                    name: "COMPANY_NAME",
                    label: "收发货人",
                    type: "dropdown",
                    dropdownType: "ajax",
                    url: "../../order-dropdown/company",
                    op: "eq",
                    minLength: 0,
                    keyWordName: "key",
                    success: function (data) {
                        data = data.results;
                        var array = new Array();
                        $.each(data, function (i, n) {
                            array.push(
                                [n["name"], n["name"].replace(/\d+/g, '').replace("<br />", "")]);
                        });
                        return array;
                    },
                }, {
                    name: "CUSTOMER_COM_ID",
                    label: "实际委托人",
                    type: 'dropdown',
                    dropdownType: "ajax",
                    keyWordName: 'key',
                    url: "../../order-dropdown/cusCompanyByKey",
                    minLength: 0,
                    success: function (data) {
                        data = data.results;
                        var array = [];
                        $.each(data, function (i, n) {
                            array.push([n["name"], n["value"]]);
                        });
                        return array;
                    }
                }, {
                    name: "PAYMENT_TIME",
                    label: "支付时间从",
                    type: "date",
                    op: "ge"
                }, {
                    name: "PAYMENT_TIME",
                    label: "支付时间到",
                    type: "date",
                    op: "le"
                }
            ],
            buttons: {
                custom: [
                    {
                        id: "exportOperationalEfficiencyExcl",
                        value: "导出业务操作效率记录",
                        click: function () {
                            var whereCase = assembleWhereCase(formSetting.columns);
                            if (!whereCase) {
                                jw.alert("查询条件不能全空");
                                return;
                            } else {
                                whereCase = " where 1=1" + whereCase;
                                jQuery(
                                    '<form action="downloadOperationalEfficiency" method="post" style="display: none"><input name="whereCase" value="'
                                    + whereCase + '"/></form>').appendTo('body').submit().remove();
                            }
                        }
                    }
                ]
            },
            grid: {
                id: "gridTable",
                title: "查询结果",
                url: "getOperationalEfficiency",
                dataType: "application/json",
                colModel: [{
                    index: "DECLARATION_TYPE",
                    name: "declarationType",
                    label: "业务类型"
                }, {
                    index: "supCom.COM_NAME",
                    name: "customsBroker",
                    label: "报关行"
                }, {
                    index: "CONTRACT_NO",
                    name: "contractNO",
                    label: "合同协议号"
                }, {
                    index: "BUSINESS_ID",
                    name: "businessId",
                    label: "业务编号"
                }, {
                    sortable: false,
                    name: "containerNO",
                    label: "集装箱号"
                }, {
                    index: "COMPANY_NAME",
                    name: "companyName",
                    label: "收发货人"
                }, {
                    index: "BL_NO",
                    name: "blNo",
                    label: "提运单号"
                }, {
                    index: "ac.COM_NAME",
                    name: "actualClient",
                    label: "实际委托人"
                }, {
                    index: "SNO",
                    name: "sno",
                    label: "报关单号"
                }, {
                    index: "PAYMENT_TIME",
                    name: "paymentTime",
                    label: "客户支付时间"
                }, {
                    name: "declarant",
                    label: "审核人"
                }, {
                    index: "PAYMENT_TIME",
                    sortable: false,
                    name: "validator",
                    label: "申报操作人"
                }, {
                    sortable: false,
                    name: "validateTimeConsuming",
                    label: "业务审核耗时"
                }, {
                    sortable: false,
                    name: "declarationTimeConsuming",
                    label: "业务申报耗时"
                }, {
                    sortable: false,
                    name: "totalTimeConsuming",
                    label: "总处理耗时"
                }]
            }

        };
        $(document).ready(function () {
            $("#dataTable").mrdForm(formSetting);
        });
    </script>
</head>
<body>
<div id="dataTable"></div>
</body>
</html>

